<template>
	<view>
		<view class="gif-q">
			<view class="gif-w" v-for="(item,index) in listData" :key="index"  @tap="$yrouter.push({ path: '/pages/shop/GoodsCon/index', query: { id: item.id } })">
				<view class="gif-e"><image :src="item.image" mode=""></image></view>
				<view class="gif-r">
					<view class="gif-t">{{item.storeName}}</view>
					<view class="gif-y">
						<view class="gif-u">
							{{item.price}}豆
							<text>{{item.otPrice}}豆</text>
						</view>
						<!-- <view class="gif-i"><image src="../../static/img/jia.png" mode=""></image></view> -->
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { getFloorData,getjicaiData } from '@/api/activity';
export default {
	data() {
		return {
			listData:[],
		};
	},
	mounted() {
		if(this.$yroute.query.type == 1){
			this.getInfor()
			uni.setNavigationBarTitle({
				title: '礼品专区'//想要显示的顶部标题
			});
		}else{
			this.getjicaiData()
			uni.setNavigationBarTitle({
				title: '集采专区'//想要显示的顶部标题
			});
		}
	},
	methods: {
		getInfor(){
			getFloorData().then(res => {
				if(res.status ==200){
					this.listData = res.data[0].cateProductList
				}
			});
		},
		getjicaiData(){
			getjicaiData().then(res => {
				if(res.status ==200){
					this.listData = res.data[0].cateProductList
				}
			});
		}
	}
};
</script>

<style lang="less" scoped>
.gif-q {
	width: 94%;
	margin: 24rpx auto;
	.gif-w {
		display: flex;
		margin-bottom: 24rpx;
		.gif-e {
			width: 208rpx;
			height: 160rpx;
			margin-top: 16rpx;
			margin-left: 16rpx;
			image {
				width: 100%;
				height: 100%;
				border-radius: 16rpx;
			}
		}
		.gif-r {
			margin-top: 32rpx;
			margin-left: 16rpx;
			.gif-t {
				width: 406rpx;
				font-size: 24rpx;
				font-family: Source Han Sans CN;
				font-weight: 600;
				color: #333333;
				line-height: 36rpx;
				overflow: hidden; //超出的文本隐藏
				text-overflow: ellipsis; //溢出用省略号显示
				display: -webkit-box;
				-webkit-line-clamp: 2; // 超出多少行
				-webkit-box-orient: vertical;
			}
			.gif-y {
				margin-top: 34rpx;
				display: flex;
				.gif-u {
					font-size: 24rpx;
					font-family: Source Han Sans CN;
					font-weight: 600;
					color: #ee1919;
					line-height: 36rpx;
					text {
						font-size: 24rpx;
						font-family: Source Han Sans CN;
						font-weight: 600;
						text-decoration: line-through;
						color: #999999;
						line-height: 36rpx;
						margin-left: 40rpx;
					}
				}
				.gif-i {
					width: 40rpx;
					height: 40rpx;
					margin-left: 248rpx;
					image {
						width: 100%;
						height: 100%;
					}
				}
			}
		}
	}
}
</style>
